
<%
	/**
	 购物车列表查看信息模板
	 **/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>购物车信息查看</title>
		<link rel="stylesheet" href="/safeai/css/safeai/customeViewStyle.css"
			type="text/css" />
		<link rel="stylesheet"
			href="/safeai/css/safeai/customeInfoListStyle.css" type="text/css" />
		<%@ include file="/pages/safeai/view/common/taglib.jsp"%>
	</head>
	<body>
		<%@ include file="/pages/safeai/view/common/head.jsp"%>


		<DIV class=block>
			<DIV id=cart-index class=CartWrap>
				<DIV class="CartNav clearfix">
					<DIV class=floatLeft>
						<IMG alt=购物流程--查看购物车
							src="${ctx }/images/safeai/chargecart/cartnav-step1.gif">
					</DIV>
					<DIV class=floatRight>
						<IMG src="${ctx }/images/safeai/chargecart/cartnav-cart.gif">
					</DIV>
				</DIV>
				<DIV id=cart-items class=section>

					<DIV id=cartItems class=FormWrap>
						<H3>
							已放入购物车的商品:
						</H3>
						请在此确认你要购买的商品
						<BR>

						<BR>
						<DIV id=goodsbody class=division>
							<TABLE class=liststyle cellSpacing=0 cellPadding=3 width="100%">
								<COLGROUP>
									<COL class="span-2 "></COL>
									<COL class=span-auto></COL>
									<COL class=span-2></COL>
									<COL class=span-2></COL>
									<COL class=span-2></COL>
									<COL class=span-2></COL>
									<COL class="span-2 ColColorOrange"></COL>
									<COL class=span-2></COL>
								<THEAD>
									<TR>
										<TH>
											图片
										</TH>
										<TH>
											商品名称
										</TH>
										<TH>
											商品积分
										</TH>
										<TH>
											销售价格
										</TH>
										<TH>
											优惠价格
										</TH>
										<TH>
											数量
										</TH>
										<TH>
											小计
										</TH>
										<TH>
											删除
										</TH>
									</TR>
								</THEAD>
								<TBODY>
									<logic:present name="ShoppingCart" scope="session">
										<!--循环购物车数据-->
										<logic:iterate id="sc" name="ShoppingCart">
											<input type="hidden" name="freeDeliver"
												value="${sc.value.freeDeliver}" />
											<input type="hidden" name="taxPrice"
												value="${sc.value.taxPrice}" />
											<input type="hidden" name="price" value="${sc.value.price}" />
											<input type="hidden" name="getPoint"
												value="${sc.value.getPoint}" />
											<form action="${ctx}/shopping/viewShoppingCart.do"
												id="${sc.key}form" method="post">
												<span style="margin-top: 15px"> <label
														style="width: 80px; height: 20px;">
														<input type="hidden" name="m" value="updateNumForward"
															style="width: 0; height: 0; line-height: 0;" />
														<input type="hidden" name="id" value="${sc.key}"
															style="width: 0; height: 0; line-height: 0;" />
														<input type="hidden" name="hiddquantity"
															value="${sc.value.quantity}"
															style="width: 0; height: 0; line-height: 0;" />
														<input type="hidden" name="quantity" value=""
															style="width: 0; height: 0; line-height: 0;" />
											</form>

											<TR price="${sc.value.price}"
												urlremove="?cart-g-removeCart.html"
												urlupdate="?cart-g-10154@7825@3273_0_1|-updateCart.html"
												number="1">
												<TD>
													<DIV style="WIDTH: 50px; HEIGHT: 50px"
														class=cart-product-img ghref="?product-10154.html"
														isrc="${ctx }/product_image/${sc.value.id}/${sc.value.id}_1_l_1_50X50.jpg">
														<A
															style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px"
															href="${ctx }/product/productMessage.do?method=shopDeatails&id=${sc.value.id}"
															target=_blank><IMG style="CURSOR: pointer"
																src="${ctx }/product_image/${sc.value.id}/${sc.value.id}_1_l_1_50X50.jpg"
																width=50 height=50> </A>
													</DIV>
												</TD>
												<TD style="TEXT-ALIGN: left">
													<a
														href="${ctx}/product/productMessage.do?method=shopDeatails&id=${sc.value.id}"
														target="_blank" class="text_ad"> ${sc.value.pname}</a>
												</TD>
												<TD>
													${sc.value.point}
												</TD>
												<TD class=" mktprice1">
													￥${sc.value.price}
												</TD>
												<TD>
													￥${sc.value.price}
												</TD>
												<TD>
													<DIV class=Numinput>
														<INPUT class="_x_ipt textcenter"
															onchange="adjustPudNumber(this,'${sc.key}')"
															value='${sc.value.quantity}' size=3 type=text
															name='cartNum${sc.key }' id='cartNum${sc.key }'>
														<SPAN class="numadjust increase"
															onclick="numAdjustIncrease('${sc.key}')"></SPAN><SPAN
															class="numadjust decrease"
															onclick="numberAdjustDecrease('${sc.key}')"></SPAN>
													</DIV>
												</TD>
												<TD class="itemTotal fontcolorRed">
													￥${sc.value.sum}
												</TD>
												<TD>
													<SPAN class="lnk quiet fontcolorRed"><IMG
															onclick='removeCartProduct("${sc.value.pname}","${sc.key}");'
															style="BACKGROUND-IMAGE: url(${ctx }/images/safeai/chargecart/bundle.gif); WIDTH: 13px; BACKGROUND-REPEAT: no-repeat; BACKGROUND-POSITION: 0px -27px; HEIGHT: 13px"
															alt=删除
															src="${ctx }/images/safeai/chargecart/transparent.gif">
													</SPAN>
												</TD>
											</TR>

										</logic:iterate>

										<logic:iterate id="frees" name="free" scope="session">
											<TR price="${frees.value.price}"
												urlremove="?cart-g-removeCart.html"
												urlupdate="?cart-g-10154@7825@3273_0_1|-updateCart.html"
												number="1">
												<TD>
													<DIV style="WIDTH: 50px; HEIGHT: 50px"
														class=cart-product-img ghref="?product-10154.html"
														isrc="${ctx }/product_image/${frees.value.id}/${frees.value.id}_1_l_1_50X50.jpg">
														<A
															style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px"
															href="${ctx }/product/productMessage.do?method=shopDeatails&id=${frees.value.id}"
															target=_blank><IMG style="CURSOR: pointer"
																src="${ctx }/product_image/${frees.value.id}/${frees.value.id}_1_l_1_50X50.jpg"
																width=50 height=50> </A>
													</DIV>
												</TD>
												<TD style="TEXT-ALIGN: left">
													<A href="?product-10154.html" target=_blank><a
														href="${ctx}/product/productMessage.do?method=shopDeatails&id=${frees.value.id}"
														target="_blank" class="text_ad"> ${frees.value.pname}</a>
													</A>
												</TD>
												<TD>
													赠品
												</TD>
												<TD class=" mktprice1">
													￥${frees.value.price}
												</TD>
												<TD>
													---
												</TD>
												<TD>
													<DIV class=Numinput>
														<INPUT class="_x_ipt textcenter" style="disabled: true;"
															value='${frees.value.quantity}' size=3 type=text
															name=cartNum[g][10154-7825-3273_0_1|]>

													</DIV>
												</TD>
												<TD class="itemTotal fontcolorRed">
													---
												</TD>
												<TD>
													<SPAN class="lnk quiet fontcolorRed">--- </SPAN>
												</TD>
											</TR>
										</logic:iterate>
									</logic:present>
									<logic:notPresent name="ShoppingCart" scope="session">
										<TR>
											<td colspan="8" style="TEXT-ALIGN: center">
												<div id="cart-none-msg">
													<div class='note' style='border-width: 1px;'>
														<h3>
															购物车目前没有加入任何商品!
														</h3>
														<ul class='list'>
															<li>
																<a href='/safeai/pages/safeai/view/indexView.jsp'>继续挑选商品»»</a>
															</li>
															<li>
																<a href='javascript:opener=null;window.close();'>关闭此页面</a>
															</li>
														</ul>
													</div>
												</div>
											</td>
										</TR>
									</logic:notPresent>
								</TBODY>
							</TABLE>
						</DIV>
						<DIV style="WIDTH: 45%" class=span-auto>
							<DIV id=cart-coupon>
								对以上商品使用优惠券：</{T}>
								<INPUT id=-s-ipt-coupon class="x-input " value=请输入优惠券号码 size=30
									type=text name=coupon vtype="text" autocomplete="off">
								<INPUT id=cart-coupon-submitBtn value=确定 type=button>
							</DIV>
						</DIV>
						<DIV style="WIDTH: 45%" class=floatRight>
							<DIV id=cartTotal>
								<DIV style="DISPLAY: none" id=cart-total-item
									class="division total-item">
									<TABLE class=liststyle_data cellSpacing=0 cellPadding=3
										width="100%">
										<COLGROUP>
											<COL class=span-auto></COL>
											<COL class=span-2></COL>
										<TBODY></TBODY>
									</TABLE>
								</DIV>


								<TABLE class=liststyle_data cellSpacing=0 cellPadding=3
									width="100%">
									<COLGROUP>
										<COL class=span-auto></COL>
										<COL class=span-2></COL>
									<TBODY>
										<TR>
											<TH align=right>
												<SPAN style="COLOR: #000; FONT-SIZE: 14px">商品总额：</SPAN>
											</TH>
											<TD>
												<SPAN style="PADDING-RIGHT: 15px" class="totalprice price1">￥${TOTAL_SHOPPING_CART_PRICE}</SPAN>
											</TD>
										</TR>
									</TBODY>
								</TABLE>
							</DIV>
						</DIV>
						<DIV class=clear></DIV>
					</DIV>
					<FORM id=form-cart method=post
						action="${ctx }/shopping/viewShoppingCart.do" extra="cart">
						<input type="hidden" name="m" value="addProductForward">
						<DIV style="MARGIN-BOTTOM: 5px" class="CartBtn clearfix">
							<DIV class=span-auto>
								<A class="actbtn btn-return"
									href="/safeai/pages/safeai/view/indexView.jsp">?继续逛逛</A>
							</DIV>
							<DIV class=span-auto>
								<A id=clearCart class="actbtn btn-clearcat"
									href="javascript:emptyCart();">清空购物车</A>
							</DIV>
							<DIV class="span-auto floatRight">
								<INPUT class="actbtn btn-next" value=下单结算? type=submit>
							</DIV>
						</DIV>
					</FORM>
				</DIV>
			</DIV>
		</DIV>
		<div class="clear"></div>
		<script type="text/javascript">

/**商品数量调整***/
function numAdjustIncrease(pid){
   var strFormId = pid+'form';
   var strCartnumberId = 'cartNum'+pid;
   var iquantity = document.getElementById(strCartnumberId).value;
	var objFrom = document.forms[strFormId];
	objFrom.quantity.value=parseInt(iquantity)+1;
	objFrom.submit();
}

//减少购物车商品数量信息
function numberAdjustDecrease(pid){
   var strFormId = pid+'form';
   var strCartnumberId = 'cartNum'+pid;
   var iquantity = document.getElementById(strCartnumberId).value;
   if(parseInt(iquantity) >= 2){
   		var objFrom = document.forms[strFormId];
   		objFrom.quantity.value=parseInt(iquantity)-1;
   		objFrom.submit();
   }else{
   	 MessageBox.error("商品的数量不能小于1!");
   }
}
//增加购物车商品数量信息
function adjustPudNumber(obj,pid){
	var iquantity = obj.value;
	var strFormId = pid+'form';
	if(parseInt(iquantity) >= 1){
   		var objFrom = document.forms[strFormId];
   		objFrom.quantity.value=parseInt(iquantity);
   		objFrom.submit();
   }else{
   		MessageBox.error("商品的数量不能小于1!");
   }
}
//删除购物车信息
function removeCartProduct(pname,pid){
	if(confirm('是否确认删除:'+pname)){
		var strFormId = pid+'form';
		var objFrom = document.forms[strFormId];
		objFrom.m.value= 'delete';
		objFrom.m.id= pid;
		objFrom.submit();
	}
}
//清空购物车信息
function emptyCart(){
	if(confirm('是否确认清除购物车信息!')){
		var objFrom = document.forms[0];
		objFrom.m.value= 'clear';
		objFrom.submit();
	}
}

</script>
		<%@ include file="/pages/safeai/view/common/foot.jsp"%>
	</body>
</html>